sdpackagemgr module

class sd.api.sdpackagemgr.SDPackageMgr(APIContext, handle, *args, **kwargs)

Bases: sd.api.sdapiobject.SDAPIObject

Provides functions to create, list, load and save SDPackage. There is only one SDPackageMgr, that you can retrieve from the SDApplication

getClassName() → str

Returns the most specific name of the class this APIObject is

getPackages() → sd.api.sdarray.SDArray[sd.api.sdpackage.SDPackage][sd.api.sdpackage.SDPackage]

Returns the list of all loaded packages

getUserPackageFromFilePath(sdPackageFileAbsPath: str) → Optional[sd.api.sdpackage.SDPackage]

Get the user package from its file path. The package must have been previously loaded using ‘loadUserPackage’

Parameters

sdPackageFileAbsPath – The absolute file path of the package to find

getUserPackages() → sd.api.sdarray.SDArray[sd.api.sdpackage.SDPackage][sd.api.sdpackage.SDPackage]

Returns the list of all loaded user packages

loadUserPackage(sdPackageFileAbsPath: str, updatePackages: bool = True, reloadIfModified: bool = True) → Optional[sd.api.sdpackage.SDPackage]

Load a package from its file path

Parameters
  • sdPackageFileAbsPath – The absolute file path of the package to load

  • updatePackages – If True then packages will be updated if needed.

  • reloadIfModified – If True then packages will be reloaded if modified.

newUserPackage() → Optional[sd.api.sdpackage.SDPackage]

Create a new user package

release() → None

Releases an APIObject

saveCopyOfPackageAs(sdPackage: sd.api.sdpackage.SDPackage, fileAbsPath: str) → None

Save a copy of the specified package to the specified location

Parameters
  • sdPackage – The package to save

  • fileAbsPath – The absolute file path used to save the package

savePackage(sdPackage: sd.api.sdpackage.SDPackage) → None

Save the specified package if it was saved before. Otherwise, it raises an exception

Parameters

sdPackage – The package to save

savePackageAs(sdPackage: sd.api.sdpackage.SDPackage, fileAbsPath: str) → None

Save the specified package to the specified location

Parameters
  • sdPackage – The package to save

  • fileAbsPath – The absolute file path used to save the package

unloadUserPackage(sdPackage: sd.api.sdpackage.SDPackage) → None

Unload the specified package

Parameters

sdPackage – The package to unload